package ThreadDemo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 故我
 * Date: 2023-10-09
 * Time: 21:35
 */
public class ThreadDemo15 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        //wait之前释放锁，再去阻塞等待，最后等待被唤醒，再尝试重新去获取锁，继续执行程序
        synchronized (object) {
            System.out.println("wait 之前！");
            object.wait();
            System.out.println("wait 之后！");
        }
    }
}
